{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 单项式空间\n",
    "\n",
    "|$\\mathbf \\alpha$ | $\\alpha$ | 单项式  $m_\\alpha$ | $\\nabla m_{\\alpha}$ |$\\Delta m_\\alpha$ |\n",
    "|--------|---------|\n",
    "|(0, 0, 0)  | 0|  1 |  (0, 0, 0) | 0 |\n",
    "|(1, 0, 0)  | 1| $\\frac{x - x_E}{h_E}$ | $(\\frac{1}{h_E}, 0, 0)$| 0 |\n",
    "|(0, 1, 0)  | 2| $\\frac{y - y_E}{h_E}$ | $(0, \\frac{1}{h_E}, 0)$| 0 |\n",
    "|(0, 0, 1)  | 3| $\\frac{z - z_E}{h_E}$ | $(0, 0, \\frac{1}{h_E})$| 0 |\n",
    "|(2, 0, 0)  | 4| $(\\frac{x - x_E}{h_E})^2$ | $(\\frac{2(x - x_E)}{h_E^2}, 0, 0)$| $\\frac{2}{h_E^2}$|\n",
    "|(1, 1, 0)  | 5| $\\frac{(x - x_E)(y - y_E)}{h_E^2}$ | $(\\frac{y - x_E}{h_E^2}, \\frac{x - x_E}{h_E^2}, 0)$ | 0 |\n",
    "|(1, 0, 1)  | 6| $\\frac{(x - x_E)(z - z_E)}{h_E^2}$ | $(\\frac{z - z_E}{h_E^2}, 0,\\frac{x - x_E}{h_E^2})$ | 0 |\n",
    "|(0, 2, 0)  | 7| $(\\frac{y - y_E}{h_E})^2$ |$(0, \\frac{2(y - y_E)}{h_E^2}, 0)$ | $\\frac{2}{h_E^2}$|\n",
    "|(0, 1, 1)  | 8| $\\frac{(y - y_E)(z - z_E)}{h_E^2}$ | $(0,\\frac{(z - z_E)}{h_E^2},\\frac{(y - y_E)}{h_E^2})$|$0$\n",
    "|(0, 0, 2)  |9| $\\frac{(z - z_E)^2}{h_E^2}$ |$(0, 0, \\frac{2(z - z_E)}{h_E^2})$ | $\\frac{2}{h_E^2}$\n",
    "|(3, 0, 0)  |10| $(\\frac{x - x_E}{h_E})^3$ | $(\\frac{3(x - x_E)^2}{h_E^3}, 0, 0)$|$\\frac{6(x - x_E)}{h_E^3}$|\n",
    "|(2, 1, 0)  |11| $\\frac{(x - x_E)^2(y-y_E)}{h_E^3}$ | $(\\frac{2(x - x_E)(y-y_E)}{h_E^3}, \\frac{(x - x_E)^2}{h_E^3}, 0)$|$\\frac{2(y-y_E)}{h_E^3}$|\n",
    "|(2, 0, 1)  |12| $\\frac{(x - x_E)^2(z-z_E)}{h_E^3}$ | $(\\frac{2(x - x_E)(z-z_E)}{h_E^3}, 0,\\frac{(x - x_E)^2}{h_E^3})$|$\\frac{2(z-z_E)}{h_E^3}$|\n",
    "|(1, 2, 0)  |13| $\\frac{(x - x_E)(y-y_E)^2}{h_E^3}$ | $(\\frac{(y - y_E)^2}{h_E^3}, \\frac{2(x-x_E)(y - y_E)}{h_E^3},0)$|$\\frac{2(x-x_E)}{h_E^3}$|\n",
    "|(1, 1, 1)  |14| $\\frac{(x - x_E)(y-y_E)(z-z_E)}{h_E^3}$ | $(\\frac{(y - y_E)(z-z_E)}{h_E^3}, \\frac{(x-x_E)(z - z_E)}{h_E^3},\\frac{(x-x_E)(y - y_E)}{h_E^3})$|$0$|\n",
    "|(1, 0, 2)  |15| $\\frac{(x - x_E)(z-z_E)^2}{h_E^3}$ | $(\\frac{(z-z_E)^2}{h_E^3},0, \\frac{2(x-x_E)(z - z_E)}{h_E^3})$|$\\frac{2(x-x_E)}{h_E^3}$|\n",
    "|(0, 3, 0)  |16| $(\\frac{y - y_E}{h_E})^3$ |$(0, \\frac{3(y - y_E)^2}{h_E^3}, 0)$ | $\\frac{6(y-y_E)}{h_E^3}$|\n",
    "|(0, 2, 1)  | 17| $\\frac{(y - y_E)^2(z - z_E)}{h_E^3}$ | $(0,\\frac{2(y - y_E)(z - z_E)}{h_E^3},\\frac{(y - y_E)^2}{h_E^3})$|$\\frac{2(z-z_E)}{h_E^3}$\n",
    "|(0, 1, 2)  | 18| $\\frac{(y - y_E)(z - z_E)^2}{h_E^3}$ | $(0,\\frac{(z - z_E)^2}{h_E^3},\\frac{2(y - y_E)(z - z_E)}{h_E^3})$|$\\frac{2(y-y_E)}{h_E^3}$\n",
    "|(0, 0, 3)  |19| $\\frac{(z - z_E)^3}{h_E^3}$ |$(0, 0, \\frac{3(z - z_E)^2}{h_E^3})$ | $\\frac{6(z-z_E)}{h_E^3}$\n",
    "|(4, 0, 0)  |20| $(\\frac{x - x_E}{h_E})^4$ | $(\\frac{4(x - x_E)^3}{h_E^4}, 0, 0)$|$\\frac{12(x - x_E)^2}{h_E^4}$|\n",
    "|(3, 1, 0)  |21| $\\frac{(x - x_E)^3(y-y_E)}{h_E^4}$ | $(\\frac{3(x - x_E)^2(y-y_E)}{h_E^4}, \\frac{(x - x_E)^3}{h_E^4}, 0)$|$\\frac{6(x-x_E)(y-y_E)}{h_E^4}$|\n",
    "|(3, 0, 1)  |22| $\\frac{(x - x_E)^3(z-z_E)}{h_E^4}$ | $(\\frac{3(x - x_E)^2(z-z_E)}{h_E^4}, 0,\\frac{(x - x_E)^3}{h_E^4})$|$\\frac{6(x-x_E)(z-z_E)}{h_E^4}$|\n",
    "|(2, 2, 0)  |23| $\\frac{(x - x_E)^2(y-y_E)^2}{h_E^4}$ | $(\\frac{2(x - x_E)(y-y_E)^2}{h_E^4}, \\frac{2(x - x_E)^2(y-y_E)}{h_E^4}, 0)$|$\\frac{2(x-x_E)^2+2(y-y_E)^2}{h_E^4}$|\n",
    "|(2, 1, 1)  |24| $\\frac{(x - x_E)^2(y-y_E)(z-z_E)}{h_E^4}$ | $(\\frac{2(x - x_E)(y-y_E)(z-z_E)}{h_E^4}, \\frac{(x - x_E)^2(z-z_E)}{h_E^4}, \\frac{(x - x_E)^2(y-y_E)}{h_E^4})$|$\\frac{2(y-y_E)(z-z_E)}{h_E^4}$|\n",
    "|(2, 0, 2)  |25| $\\frac{(x - x_E)^2(z-z_E)^2}{h_E^4}$ | $(\\frac{2(x - x_E)(z-z_E)^2}{h_E^4}, 0, \\frac{2(x - x_E)^2(z-z_E)}{h_E^4})$|$\\frac{2(x-x_E)^2+2(z-z_E)^2}{h_E^4}$|\n",
    "|(1, 3, 0)  |26| $\\frac{(x - x_E)(y-y_E)^3}{h_E^4}$ | $(\\frac{(y-y_E)^3}{h_E^4}, \\frac{3(x - x_E)(y-y_E)^2}{h_E^4}, 0)$|$\\frac{6(x-x_E)(y-y_E)}{h_E^4}$|\n",
    "|(1, 2, 1)  |27| $\\frac{(x - x_E)(y-y_E)^2(z-z_E)}{h_E^4}$ | $(\\frac{(y-y_E)^2(z-z_E)}{h_E^4}, \\frac{2(x - x_E)(y-y_E)(z-z_E)}{h_E^4}, \\frac{(x - x_E)(y-y_E)^2}{h_E^4})$|$\\frac{2(x-x_E)(z-z_E)}{h_E^4}$|\n",
    "|(1, 1, 2)  |28| $\\frac{(x - x_E)(y-y_E)(z-z_E)^2}{h_E^4}$ | $(\\frac{(y-y_E)(z-z_E)^2}{h_E^4}, \\frac{(x - x_E)(z-z_E)^2}{h_E^4}, \\frac{2(x - x_E)(y-y_E)(z-z_E)}{h_E^4})$|$\\frac{2(x-x_E)(y-y_E)}{h_E^4}$|\n",
    "|(1, 0, 3)  |29| $\\frac{(x - x_E)(z-z_E)^3}{h_E^4}$ | $(\\frac{(z-z_E)^3}{h_E^4},0, \\frac{3(x - x_E)(z-z_E)^2}{h_E^4})$|$\\frac{6(x-x_E)(z-z_E)}{h_E^4}$|\n",
    "|(0, 4, 0)  |30| $(\\frac{y - y_E}{h_E})^4$ | $(0,\\frac{4(y - y_E)^3}{h_E^4}, 0)$|$\\frac{12(y - y_E)^2}{h_E^4}$|\n",
    "|(0, 3, 1)  |31| $(\\frac{(y - y_E)^3(z-z_E)}{h_E^4})$ | $(0,\\frac{3(y - y_E)^2(z-z_E)}{h_E^4},\\frac{(y - y_E)^3}{h_E^4})$|$\\frac{6(y - y_E)(z-z_E)}{h_E^4}$|\n",
    "|(0, 2, 2)  |32| $\\frac{(y - y_E)^2(z-z_E)^2}{h_E^4}$ | $(0, \\frac{2(y - y_E)(z-z_E)^2}{h_E^4}, \\frac{2(y - y_E)^2(z-z_E)}{h_E^4})$|$\\frac{2(y-y_E)^2+2(z-z_E)^2}{h_E^4}$|\n",
    "|(0, 1, 3)  |33| $(\\frac{(y - y_E)(z-z_E)^3}{h_E^4})$ | $(0,\\frac{(z - z_E)^3}{h_E^4},\\frac{3(y - y_E)(z-z_E)^2}{h_E^4})$|$\\frac{6(y - y_E)(z-z_E)}{h_E^4}$|\n",
    "|(0, 0, 4)  |34| $(\\frac{z - z_E}{h_E})^4$ | $(0,0,\\frac{4(z - z_E)^3}{h_E^4})$|$\\frac{12(z - z_E)^2}{h_E^4}$|"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "综上可得, 当 $a < 2$, $b<2$ 且 $c<2$ 时, 有:\n",
    "\n",
    "$$\n",
    "\\Delta(a,b,c) = (0,0,0)\n",
    "$$\n",
    "\n",
    "当 $a \\geq 2$, $b\\geq 2$ 或 $c\\geq 2$ 时,有:\n",
    "\n",
    "$$\n",
    "\\Delta(a,b,c) = \\frac{\\max\\{a,b,c\\}(\\max\\{a,b,c\\}-1)}{h_E^2}[(a-2,b,c) + (a,b-2,c)+(a,b,c-2)]\n",
    "$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "这里规定 $a-2<0$ 时, $(a-2,b,c) = 0$; $b-2<0$ 时, $(a,b-2,c) = 0$; $c-2<0$ 时, $(a,b,c-2) = 0$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "若已知 $(a,b)$, 则对应的 $\\alpha$ 编号为:\n",
    "\n",
    "$$\n",
    "\\alpha = \\frac{(a+b+c)(a+b+c+1)(a+b+c+2)}{6}+\\frac{(b+c)(b+c+1)}{2}+c\n",
    "$$\n",
    "\n",
    "若已知 $\\alpha$, 则对应的 $(a, b, c)$, 计算公式为\n",
    "$$\n",
    "a+b+c = \\left\\lfloor \\left(3\\alpha+\\frac{1}{3}\\sqrt{81\\alpha^2-\\frac{1}{3}}\\right)^{\\frac{1}{3}}+\\frac{1}{3\\left(3\\alpha+\\frac{1}{3}\\sqrt{81\\alpha^2-\\frac{1}{3}}\\right)^{\\frac{1}{3}}}-1\\right\\rfloor\\\\\n",
    "\\frac{(b+c)(b+c+1)}{2}+c = \\alpha - \\frac{(a+b+c)(a+b+c+1)(a+b+c+2)}{6}\n",
    "$$\n",
    "\n",
    "设 $\\alpha - \\frac{(a+b+c)(a+b+c+1)(a+b+c+2)}{6} = k$ ,则\n",
    "\n",
    "$$\n",
    "b+c = \\lfloor \\frac{-1+\\sqrt{1+8k}}{2}\\rfloor\\\\\n",
    "c = k - \\frac{(b+c)(b+c+1)}{2}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
